//
//  tuikuanguanliViewController.m
//  个人信息
//
//  Created by IOSchengxuyuan on 15/12/7.
//  Copyright © 2015年 com.ppfur. All rights reserved.
//

#import "tuikuanguanliViewController.h"

@interface tuikuanguanliViewController (){
    float aa,bb;
    float width,height;
    UITableViewCell*cell;
}

@end

@implementation tuikuanguanliViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    _mytable.delegate=self;
    _mytable.dataSource=self;
    width=[UIScreen mainScreen].bounds.size.width;
    height=[UIScreen mainScreen].bounds.size.height;
    aa=width/320;
    bb=height/568;
    _mytable.frame=CGRectMake(0, 0, width, height-60);
    
    // Do any additional setup after loading the view.
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 3;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 2;
}
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
    return 5;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    if (indexPath.row==0) {
        return 40;
    }else{
        return 170;
    }
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    static NSString *id=@"row";
    cell=[tableView dequeueReusableCellWithIdentifier:id];
    if (cell==nil)
    {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:id];
    }
    NSArray *row1=[cell.contentView subviews];
    //    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    for (UIView *vv2 in row1)
    {
        [vv2 removeFromSuperview];
    }
    if (indexPath.section==0) {
        if (indexPath.row==0) {
            UILabel*ll1=[[UILabel alloc] initWithFrame:CGRectMake(20*aa, 10*bb, 100*aa, 20*bb)];
            ll1.text=@"某某皮草店";
            ll1.font=[UIFont systemFontOfSize:15.0f];
            [cell.contentView addSubview:ll1];
            UILabel*ll2=[[UILabel alloc] initWithFrame:CGRectMake(250*aa, 10*bb, 60*aa, 20*bb)];
            ll2.text=@"退款成功";
            ll2.font=[UIFont systemFontOfSize:13.0f];
            ll2.textColor=[UIColor redColor];
            [cell.contentView addSubview:ll2];
        }else if(indexPath.row==1){
            UIImageView*ii1=[[UIImageView alloc] initWithFrame:CGRectMake(10*aa, 10*bb, 70*aa, 70*bb)];
            ii1.image = [UIImage imageNamed:@"dd2.jpg"];
            [cell.contentView addSubview:ii1];
            UILabel*ll4=[[UILabel alloc] initWithFrame:CGRectMake(90*aa, 10*bb, 260*aa, 20*bb)];
            ll4.text=@"手提包女款时尚手提包女款时尚手提包女款时";
            ll4.font=[UIFont systemFontOfSize:11.0f];
            [cell.contentView addSubview:ll4];
            
            UILabel*ll1=[[UILabel alloc] initWithFrame:CGRectMake(90*aa, 35*bb, 50*aa, 20*bb)];
            ll1.text=@"颜色:";
            ll1.font=[UIFont systemFontOfSize:11.0f];
            ll1.textColor=[UIColor redColor];
            [cell.contentView addSubview:ll1];
            UILabel*ll2=[[UILabel alloc] initWithFrame:CGRectMake(125*aa, 35*bb, 50*aa, 20*bb)];
            ll2.text=@"黑色";
            ll2.font=[UIFont systemFontOfSize:11.0f];
            ll2.textColor=[UIColor redColor];
            [cell.contentView addSubview:ll2];
            UILabel*ll3=[[UILabel alloc] initWithFrame:CGRectMake(160*aa, 35*bb, 50*aa, 20*bb)];
            ll3.text=@"尺码:";
            ll3.font=[UIFont systemFontOfSize:11.0f];
            ll3.textColor=[UIColor redColor];
            [cell.contentView addSubview:ll3];
            UILabel*ll5=[[UILabel alloc] initWithFrame:CGRectMake(195*aa, 35*bb, 50*aa, 20*bb)];
            ll5.text=@"170";
            ll5.font=[UIFont systemFontOfSize:11.0f];
            ll5.textColor=[UIColor redColor];
            [cell.contentView addSubview:ll5];
            UILabel*ll6=[[UILabel alloc] initWithFrame:CGRectMake(95*aa, 110, 80*aa, 20*bb)];
            ll6.text=@"交易金额:";
            ll6.font=[UIFont systemFontOfSize:12.0f];
            [cell.contentView addSubview:ll6];
            UILabel*ll7=[[UILabel alloc] initWithFrame:CGRectMake(150*aa, 110, 60*aa, 20*bb)];
            ll7.text=@"¥325.00";
            ll7.font=[UIFont systemFontOfSize:12.0f];
           
            [cell.contentView addSubview:ll7];
            UILabel*ll8=[[UILabel alloc] initWithFrame:CGRectMake(205*aa, 110, 80*aa, 20*bb)];
            ll8.text=@"退款金额";
            ll8.font=[UIFont systemFontOfSize:12.0f];
            ll8.textColor=[UIColor redColor];
            [cell.contentView addSubview:ll8];
            UILabel*ll9=[[UILabel alloc] initWithFrame:CGRectMake(260*aa, 110, 60*aa, 20*bb)];
            ll9.text=@"¥325.00";
            ll9.font=[UIFont systemFontOfSize:12.0f];
            ll9.textColor=[UIColor redColor];
            [cell.contentView addSubview:ll9];
            UIButton*bb1=[[UIButton alloc] initWithFrame:CGRectMake(190*aa, 135, 110*aa, 25*bb)];
            [bb1.layer setBorderColor:[[UIColor lightGrayColor] CGColor]];
            [bb1.layer setBorderWidth:1.0f];
            [bb1 setTitle:@"钱款去向" forState:UIControlStateNormal];
            [bb1 setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
            [cell.contentView addSubview:bb1];
            bb1.titleLabel.font=[UIFont systemFontOfSize:13.0f];
        }
    }else if(indexPath.section==1){
        if (indexPath.row==0) {
            UILabel*ll1=[[UILabel alloc] initWithFrame:CGRectMake(20*aa, 10*bb, 100*aa, 20*bb)];
            ll1.text=@"某某皮草店";
            ll1.font=[UIFont systemFontOfSize:15.0f];
            [cell.contentView addSubview:ll1];
            UILabel*ll2=[[UILabel alloc] initWithFrame:CGRectMake(250*aa, 10*bb, 60*aa, 20*bb)];
            ll2.text=@"退款未成功";
            ll2.font=[UIFont systemFontOfSize:13.0f];
            ll2.textColor=[UIColor redColor];
            [cell.contentView addSubview:ll2];
        }else if(indexPath.row==1){
            UIImageView*ii1=[[UIImageView alloc] initWithFrame:CGRectMake(10*aa, 10*bb, 70*aa, 70*bb)];
            ii1.image = [UIImage imageNamed:@"dd2.jpg"];
            [cell.contentView addSubview:ii1];
            UILabel*ll4=[[UILabel alloc] initWithFrame:CGRectMake(90*aa, 10*bb, 260*aa, 20*bb)];
            ll4.text=@"手提包女款时尚手提包女款时尚手提包女款时";
            ll4.font=[UIFont systemFontOfSize:11.0f];
            [cell.contentView addSubview:ll4];
            
            UILabel*ll1=[[UILabel alloc] initWithFrame:CGRectMake(90*aa, 35*bb, 50*aa, 20*bb)];
            ll1.text=@"颜色:";
            ll1.font=[UIFont systemFontOfSize:11.0f];
            ll1.textColor=[UIColor redColor];
            [cell.contentView addSubview:ll1];
            UILabel*ll2=[[UILabel alloc] initWithFrame:CGRectMake(125*aa, 35*bb, 50*aa, 20*bb)];
            ll2.text=@"黑色";
            ll2.font=[UIFont systemFontOfSize:11.0f];
            ll2.textColor=[UIColor redColor];
            [cell.contentView addSubview:ll2];
            UILabel*ll3=[[UILabel alloc] initWithFrame:CGRectMake(160*aa, 35*bb, 50*aa, 20*bb)];
            ll3.text=@"尺码:";
            ll3.font=[UIFont systemFontOfSize:11.0f];
            ll3.textColor=[UIColor redColor];
            [cell.contentView addSubview:ll3];
            UILabel*ll5=[[UILabel alloc] initWithFrame:CGRectMake(195*aa, 35*bb, 50*aa, 20*bb)];
            ll5.text=@"170";
            ll5.font=[UIFont systemFontOfSize:11.0f];
            ll5.textColor=[UIColor redColor];
            [cell.contentView addSubview:ll5];
            UILabel*ll6=[[UILabel alloc] initWithFrame:CGRectMake(95*aa, 110, 80*aa, 20*bb)];
            ll6.text=@"交易金额:";
            ll6.font=[UIFont systemFontOfSize:12.0f];
            [cell.contentView addSubview:ll6];
            UILabel*ll7=[[UILabel alloc] initWithFrame:CGRectMake(150*aa, 110, 60*aa, 20*bb)];
            ll7.text=@"¥325.00";
            ll7.font=[UIFont systemFontOfSize:12.0f];
            
            [cell.contentView addSubview:ll7];
            UILabel*ll8=[[UILabel alloc] initWithFrame:CGRectMake(205*aa, 110, 80*aa, 20*bb)];
            ll8.text=@"退款金额";
            ll8.font=[UIFont systemFontOfSize:12.0f];
            ll8.textColor=[UIColor redColor];
            [cell.contentView addSubview:ll8];
            UILabel*ll9=[[UILabel alloc] initWithFrame:CGRectMake(260*aa, 110, 60*aa, 20*bb)];
            ll9.text=@"¥325.00";
            ll9.font=[UIFont systemFontOfSize:12.0f];
            ll9.textColor=[UIColor redColor];
            [cell.contentView addSubview:ll9];
            UIButton*bb1=[[UIButton alloc] initWithFrame:CGRectMake(190*aa, 135, 110*aa, 25*bb)];
            [bb1.layer setBorderColor:[[UIColor lightGrayColor] CGColor]];
            [bb1.layer setBorderWidth:1.0f];
            [bb1 setTitle:@"申请退款" forState:UIControlStateNormal];
            [bb1 setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
            [cell.contentView addSubview:bb1];
            bb1.titleLabel.font=[UIFont systemFontOfSize:12.0f];
            UIButton*bb2=[[UIButton alloc] initWithFrame:CGRectMake(81*aa, 135, 110*aa, 25*bb)];
            [bb2.layer setBorderColor:[[UIColor lightGrayColor] CGColor]];
            [bb2.layer setBorderWidth:1.0f];
            [bb2 setTitle:@"直接申请售后" forState:UIControlStateNormal];
            [bb2 setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
            [cell.contentView addSubview:bb2];
            bb2.titleLabel.font=[UIFont systemFontOfSize:12.0f];

        
       }
    
    }else{
        if (indexPath.row==0) {
            UILabel*ll1=[[UILabel alloc] initWithFrame:CGRectMake(20*aa, 10*bb, 100*aa, 20*bb)];
            ll1.text=@"某某皮草店";
            ll1.font=[UIFont systemFontOfSize:15.0f];
            [cell.contentView addSubview:ll1];
            UILabel*ll2=[[UILabel alloc] initWithFrame:CGRectMake(250*aa, 10*bb, 60*aa, 20*bb)];
            ll2.text=@"退款成功";
            ll2.font=[UIFont systemFontOfSize:13.0f];
            ll2.textColor=[UIColor redColor];
            [cell.contentView addSubview:ll2];
        }else if(indexPath.row==1){
            UIImageView*ii1=[[UIImageView alloc] initWithFrame:CGRectMake(10*aa, 10*bb, 70*aa, 70*bb)];
            ii1.image = [UIImage imageNamed:@"dd2.jpg"];
            [cell.contentView addSubview:ii1];
            UILabel*ll4=[[UILabel alloc] initWithFrame:CGRectMake(90*aa, 10*bb, 260*aa, 20*bb)];
            ll4.text=@"手提包女款时尚手提包女款时尚手提包女款时";
            ll4.font=[UIFont systemFontOfSize:11.0f];
            [cell.contentView addSubview:ll4];
            
            UILabel*ll1=[[UILabel alloc] initWithFrame:CGRectMake(90*aa, 35*bb, 50*aa, 20*bb)];
            ll1.text=@"颜色:";
            ll1.font=[UIFont systemFontOfSize:11.0f];
            ll1.textColor=[UIColor redColor];
            [cell.contentView addSubview:ll1];
            UILabel*ll2=[[UILabel alloc] initWithFrame:CGRectMake(125*aa, 35*bb, 50*aa, 20*bb)];
            ll2.text=@"黑色";
            ll2.font=[UIFont systemFontOfSize:11.0f];
            ll2.textColor=[UIColor redColor];
            [cell.contentView addSubview:ll2];
            UILabel*ll3=[[UILabel alloc] initWithFrame:CGRectMake(160*aa, 35*bb, 50*aa, 20*bb)];
            ll3.text=@"尺码:";
            ll3.font=[UIFont systemFontOfSize:11.0f];
            ll3.textColor=[UIColor redColor];
            [cell.contentView addSubview:ll3];
            UILabel*ll5=[[UILabel alloc] initWithFrame:CGRectMake(195*aa, 35*bb, 50*aa, 20*bb)];
            ll5.text=@"170";
            ll5.font=[UIFont systemFontOfSize:11.0f];
            ll5.textColor=[UIColor redColor];
            [cell.contentView addSubview:ll5];
            UILabel*ll6=[[UILabel alloc] initWithFrame:CGRectMake(95*aa, 110, 80*aa, 20*bb)];
            ll6.text=@"交易金额:";
            ll6.font=[UIFont systemFontOfSize:12.0f];
            [cell.contentView addSubview:ll6];
            UILabel*ll7=[[UILabel alloc] initWithFrame:CGRectMake(150*aa, 110, 60*aa, 20*bb)];
            ll7.text=@"¥325.00";
            ll7.font=[UIFont systemFontOfSize:12.0f];
            
            [cell.contentView addSubview:ll7];
            UILabel*ll8=[[UILabel alloc] initWithFrame:CGRectMake(205*aa, 110, 80*aa, 20*bb)];
            ll8.text=@"退款金额";
            ll8.font=[UIFont systemFontOfSize:12.0f];
            ll8.textColor=[UIColor redColor];
            [cell.contentView addSubview:ll8];
            UILabel*ll9=[[UILabel alloc] initWithFrame:CGRectMake(260*aa, 110, 60*aa, 20*bb)];
            ll9.text=@"¥325.00";
            ll9.font=[UIFont systemFontOfSize:12.0f];
            ll9.textColor=[UIColor redColor];
            [cell.contentView addSubview:ll9];
            UIButton*bb1=[[UIButton alloc] initWithFrame:CGRectMake(190*aa, 135, 110*aa, 25*bb)];
            [bb1.layer setBorderColor:[[UIColor lightGrayColor] CGColor]];
            [bb1.layer setBorderWidth:1.0f];
            [bb1 setTitle:@"钱款去向" forState:UIControlStateNormal];
            [bb1 setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
            [cell.contentView addSubview:bb1];
            bb1.titleLabel.font=[UIFont systemFontOfSize:13.0f];
        }
        
    }
    
    return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    [tableView deselectRowAtIndexPath:indexPath animated:NO];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
